---
layout: m1x_soap
title: Product Create
---

	
<h2><a name="catalog_product.create-Module%3AMageCatalog"></a>Module: Mage_Catalog</h2>


<h4><a name="catalog_product.create-Resource%3Acatalogproduct"></a>Resource: catalog_product</h4>

<p><b>Aliases:</b></p>
<ul>
	<li>product</li>
</ul>


<h5><a name="catalog_product.create-Method%3A"></a>Method:</h5>

<ul>
	<li>catalog_product.create (SOAP V1)</li>
	<li>catalogProductCreate (SOAP V2)</li>
</ul>


<p>Allows you to create a new product and return ID of the created product.</p>

<p><b>Aliases:</b></p>
<ul>
	<li>product.create</li>
</ul>

<p><strong>Note:</strong></p>
<p>Although the API accepts up to four digits of precision for all price arguments, Magento strongly recommends you pass in two digits to reduce inaccuracy in the tax calculation process. (That is, use a price like 12.35 and not 12.3487).</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId <br class="atl-forced-newline" /> </td>
<td> Session ID </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> type <br class="atl-forced-newline" /> </td>
<td> Product type </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> set <br class="atl-forced-newline" /> </td>
<td> ID of the product attribute set </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> sku <br class="atl-forced-newline" /> </td>
<td> Product SKU </td>
</tr>
<tr>
<td> array </td>
<td> productData <br class="atl-forced-newline" /> </td>
<td> Array of catalogProductCreateEntity </td>
</tr>
<tr>
<td> string </td>
<td> storeView </td>
<td> Store view ID or code </td>
</tr>
</tbody></table>


<p><b>Returns</b>:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> int </td>
<td> result </td>
<td> ID of the created product </td>
</tr>
</tbody></table>


<p>The <b>catalogProductCreateEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> ArrayOfString </td>
<td> categories <br class="atl-forced-newline" /> </td>
<td> Array of categories </td>
</tr>
<tr>
<td> ArrayOfString <br class="atl-forced-newline" /> </td>
<td> websites <br class="atl-forced-newline" /> </td>
<td> Array of websites </td>
</tr>
<tr>
<td> string </td>
<td> name <br class="atl-forced-newline" /> </td>
<td> Product name </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> description <br class="atl-forced-newline" /> </td>
<td> Product description </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> short_description <br class="atl-forced-newline" /> </td>
<td> Product short description </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> weight <br class="atl-forced-newline" /> </td>
<td> Product weight </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> status <br class="atl-forced-newline" /> </td>
<td> Product status </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> url_key <br class="atl-forced-newline" /> </td>
<td> URL key </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> url_path <br class="atl-forced-newline" /> </td>
<td> URL path </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> visibility <br class="atl-forced-newline" /> </td>
<td> Product visibility on the frontend </td>
</tr>
<tr>
<td> ArrayOfString <br class="atl-forced-newline" /> </td>
<td> category_ids <br class="atl-forced-newline" /> </td>
<td> Array of category IDs </td>
</tr>
<tr>
<td> ArrayOfString <br class="atl-forced-newline" /> </td>
<td> website_ids <br class="atl-forced-newline" /> </td>
<td> Array of website IDs </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> has_options <br class="atl-forced-newline" /> </td>
<td> Defines whether the product has options </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> gift_message_available <br class="atl-forced-newline" /> </td>
<td> Defines whether the gift message is available for the product </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> price <br class="atl-forced-newline" /> </td>
<td> Product price </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> special_price <br class="atl-forced-newline" /> </td>
<td> Product special price </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> special_from_date <br class="atl-forced-newline" /> </td>
<td> Date starting from which the special price will be applied to the product </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> special_to_date <br class="atl-forced-newline" /> </td>
<td> Date till which the special price will be applied to the product </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> tax_class_id <br class="atl-forced-newline" /> </td>
<td> Tax class ID </td>
</tr>
<tr>
<td> array </td>
<td> tier_price <br class="atl-forced-newline" /> </td>
<td> Array of&nbsp;catalogProductTierPriceEntity </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> meta_title <br class="atl-forced-newline" /> </td>
<td> Meta title </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> meta_keyword <br class="atl-forced-newline" /> </td>
<td> Meta keyword </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> meta_description <br class="atl-forced-newline" /> </td>
<td> Meta description </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> custom_design <br class="atl-forced-newline" /> </td>
<td> Custom design </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> custom_layout_update <br class="atl-forced-newline" /> </td>
<td> Custom layout update </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> options_container <br class="atl-forced-newline" /> </td>
<td> Options container </td>
</tr>
<tr>
<td> array <br class="atl-forced-newline" /> </td>
<td> additional_attributes <br class="atl-forced-newline" /> </td>
<td> Array of catalogProductAdditionalAttributesEntity </td>
</tr>
<tr>
<td> array </td>
<td> stock_data <br class="atl-forced-newline" /> </td>
<td> Array of catalogInventoryStockItemUpdateEntity <br class="atl-forced-newline" /> </td>
</tr>
</tbody></table>


<p><b>Notes</b>: The "websites" and "website_ids" or "categories" and "category_ids" parameters are interchangeable. In other words, you can specify an array of website IDs (int) and then you don't need to specify the array of website codes (string) and vice versa.</p>

<p>The <b>catalogProductTierPriceEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> customer_group_id <br class="atl-forced-newline" /> </td>
<td> Customer group ID </td>
</tr>
<tr>
<td> string </td>
<td> website <br class="atl-forced-newline" /> </td>
<td> Website </td>
</tr>
<tr>
<td> int </td>
<td> qty <br class="atl-forced-newline" /> </td>
<td> Quantity </td>
</tr>
<tr>
<td> double </td>
<td> price <br class="atl-forced-newline" /> </td>
<td> Tier price </td>
</tr>
</tbody></table>


<p>The <b>catalogInventoryStockItemUpdateEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> qty <br class="atl-forced-newline" /> </td>
<td> Quantity of items </td>
</tr>
<tr>
<td> int </td>
<td> is_in_stock <br class="atl-forced-newline" /> </td>
<td> Defines whether the item is in stock </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> manage_stock <br class="atl-forced-newline" /> </td>
<td> Manage stock </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_manage_stock <br class="atl-forced-newline" /> </td>
<td> Use config manage stock </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> min_qty <br class="atl-forced-newline" /> </td>
<td> Minimum quantity for items to be in stock </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_min_qty <br class="atl-forced-newline" /> </td>
<td> Use config settings flag (value defined in the Inventory System Configuration) </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> min_sale_qty <br class="atl-forced-newline" /> </td>
<td> Minimum quantity allowed in the shopping cart </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_min_sale_qty <br class="atl-forced-newline" /> </td>
<td> Use config settings flag </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> max_sale_qty <br class="atl-forced-newline" /> </td>
<td> Maximum quantity allowed in the shopping cart </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_max_sale_qty <br class="atl-forced-newline" /> </td>
<td> Use config settings flag&nbsp; </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> is_qty_decimal <br class="atl-forced-newline" /> </td>
<td> Defines whether the quantity is decimal </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> backorders <br class="atl-forced-newline" /> </td>
<td> Backorders status </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_backorders <br class="atl-forced-newline" /> </td>
<td> Use config settings flag&nbsp;(for backorders) </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> notify_stock_qty <br class="atl-forced-newline" /> </td>
<td> Stock quantity below which a notification will appear </td>
</tr>
<tr>
<td> int <br class="atl-forced-newline" /> </td>
<td> use_config_notify_stock_qty <br class="atl-forced-newline" /> </td>
<td> Use config settings flag (for stock quantity) </td>
</tr>
</tbody></table>


<p>The <b>catalogProductAdditionalAttributesEntity</b> content is as follows:</p>


<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
</tr>
<tr>
<td> associativeMultiArray </td>
<td> multi_data </td>
</tr>
<tr>
<td> associativeArray </td>
<td> single_data </td>
</tr>
</tbody></table>


<p>Single Data: array of attributes with only single value<br/>
Multi Data: array of attributes which could contain several values</p>

<p><b>Faults:</b></p>

<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 100 </td>
<td> Requested store view not found. </td>
</tr>
<tr>
<td> 102 </td>
<td> Invalid data given. Details in error message. </td>
</tr>
<tr>
<td> 104 </td>
<td> Product type is not in allowed types. </td>
</tr>
<tr>
<td> 105 </td>
<td> Product attribute set is not existed </td>
</tr>
<tr>
<td> 106 </td>
<td> Product attribute set is not belong catalog product entity type </td>
</tr>
</tbody></table>



<h4><a name="catalog_product.create-Examples"></a>Examples</h4>

<h5><a name="catalog_product.create-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If some stuff requires API authentication,
// then get a session token
$session = $client-&gt;login('apiUser', 'apiKey');

// get attribute set
$attributeSets = $client-&gt;call($session, 'product_attribute_set.list');
$attributeSet = current($attributeSets);


$result = $client-&gt;call($session, 'catalog_product.create', array('simple', $attributeSet['set_id'], 'product_sku', array(
    'categories' =&gt; array(2),
    'websites' =&gt; array(1),
    'name' =&gt; 'Product name',
    'description' =&gt; 'Product description',
    'short_description' =&gt; 'Product short description',
    'weight' =&gt; '10',
    'status' =&gt; '1',
    'url_key' =&gt; 'product-url-key',
    'url_path' =&gt; 'product-url-path',
    'visibility' =&gt; '4',
    'price' =&gt; '100',
    'tax_class_id' =&gt; 1,
    'meta_title' =&gt; 'Product meta title',
    'meta_keyword' =&gt; 'Product meta keyword',
    'meta_description' =&gt; 'Product meta description'
)));

var_dump ($result);</pre>
		</div>
</div></div>


<h5><a name="catalog_product.create-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

// If some stuff requires API authentication,
// then get a session token
$session = $client-&gt;login('apiUser', 'apiKey');

// get attribute set
$attributeSets = $client-&gt;catalogProductAttributeSetList($session);
$attributeSet = current($attributeSets);

$result = $client-&gt;catalogProductCreate($session, 'simple', $attributeSet-&gt;set_id, 'product_sku', array(
    'categories' =&gt; array(2),
    'websites' =&gt; array(1),
    'name' =&gt; 'Product name',
    'description' =&gt; 'Product description',
    'short_description' =&gt; 'Product short description',
    'weight' =&gt; '10',
    'status' =&gt; '1',
    'url_key' =&gt; 'product-url-key',
    'url_path' =&gt; 'product-url-path',
    'visibility' =&gt; '4',
    'price' =&gt; '100',
    'tax_class_id' =&gt; 1,
    'meta_title' =&gt; 'Product meta title',
    'meta_keyword' =&gt; 'Product meta keyword',
    'meta_description' =&gt; 'Product meta description'
));

var_dump ($result);</pre>
		</div>
</div></div>

<h5><a name="catalog_product.create-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: java; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey'));

$result = $proxy-&gt;catalogProductCreate((object)array('sessionId' =&gt; $sessionId-&gt;result, 'type' =&gt; 'simple', 'set' =&gt; '4', 'sku' =&gt; 'simple_sku',
'productData' =&gt; ((object)array(
    'name' =&gt; 'Product name',
    'description' =&gt; 'Product description',
    'short_description' =&gt; 'Product short description',
    'weight' =&gt; '10',
    'status' =&gt; '1',
    'visibility' =&gt; '4',
    'price' =&gt; '100',
    'tax_class_id' =&gt; 1,
))));

var_dump($result-&gt;result);</pre>
		</div>
</div></div>


